/**
 * 
 */
package com.apache.license.model;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

/**
 * @author Hou Dayu
 * <P>系统lecence信息</P>
 */
@SuppressWarnings("serial")
public class LecenceMsg implements Serializable, Comparable<Object> {

	private String company="";//授权的公司名

	private String serverip="";//服务器的ip

	private String servermac="";//服务器的mac地址

	private Date begintime;//授权启始时间

	private int timeleng=0;//授权的时长，单位为月

	private int usernumber=0;//授权的使用的最大用户数

	private String isformal = "0";//license类型，0为试用，1为注册

	/**
	 * 
	 */
	public LecenceMsg() {
		// TODO Auto-generated constructor stub
	}

	/* (non-Javadoc)
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	public int compareTo(Object o) {
		// TODO Auto-generated method stub
		return 0;
	}

	public String toString() {
		return "LecenceMsg [begintime=" + begintime + ", company=" + company + ", serverip=" + serverip
				+ ", servermac=" + servermac + ", timeleng=" + timeleng + ", usernumber=" + usernumber + "]";
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getServerip() {
		return serverip;
	}

	public void setServerip(String serverip) {
		this.serverip = serverip;
	}

	public String getServermac() {
		return servermac;
	}

	public void setServermac(String servermac) {
		this.servermac = servermac;
	}

	public Date getBegintime() {
		if(null==begintime){
			Calendar calendar = Calendar.getInstance();
			calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) - 10);
			begintime = calendar.getTime();
		}
		return begintime;
	}

	public void setBegintime(Date begintime) {
		this.begintime = begintime;
	}

	public int getTimeleng() {
		return timeleng;
	}

	public void setTimeleng(int timeleng) {
		this.timeleng = timeleng;
	}

	public int getUsernumber() {
		return usernumber;
	}

	public void setUsernumber(int usernumber) {
		this.usernumber = usernumber;
	}

	public String getIsformal() {
		return isformal;
	}

	public void setIsformal(String isformal) {
		this.isformal = isformal;
	}

}
